package com.xiaohui.user.designPattern.responsibilityChain;

import lombok.Getter;
import org.apache.commons.collections4.CollectionUtils;

public class RuleCheckContext {

    /**
     * 规则检查结果
     */
    @Getter
    private RuleCheckResult ruleCheckResult = new RuleCheckResult();

    public boolean hasError() {

        return CollectionUtils.isNotEmpty(ruleCheckResult.getFailMsgList());
    }

    public void setRuleCheckResult(RuleCheckResult ruleCheckResult) {
        this.ruleCheckResult = ruleCheckResult;
    }
}
